package org.example.controller;

import org.example.domain.model.Result;
import org.example.service.impl.GoodsServiceImpl;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/goods")
@CrossOrigin("*")
public class GoodsController {
    private GoodsServiceImpl goodsService;

    public GoodsController(GoodsServiceImpl goodsService) {
        this.goodsService = goodsService;
    }

    @GetMapping("/select")
    public Result selectGoods(){
        Result result = goodsService.selectGoods();
        return result;
    }
}
